import request from '@/utils/request';
import { OrderRefundQuery, OrderRefundVO, OrderRefundForm } from './types';
import { AxiosPromise } from 'axios';

// 查询退款列表
export function listOrderRefund(query: OrderRefundQuery): AxiosPromise<any> {
    return request({
        url: '/order/orderRefund/list',
        method: 'get',
        params: query
    });
}

// 查询退款列表（不分页）
export function listOrderRefundAll(query: OrderRefundQuery): AxiosPromise<OrderRefundVO[]> {
    return request({
        url: '/order/orderRefund/listRefund',
        method: 'get',
        params: query
    });
}

// 查询退款详细
export function getOrderRefund(id: string | number): AxiosPromise<OrderRefundVO> {
    return request({
        url: '/order/orderRefund/' + id,
        method: 'get'
    });
}

// 新增退款
export function addOrderRefund(data: OrderRefundForm) {
    return request({
        url: '/order/orderRefund',
        method: 'post',
        data: data
    });
}

// 修改退款
export function updateOrderRefund(data: OrderRefundForm) {
    return request({
        url: '/order/orderRefund',
        method: 'put',
        data: data
    });
}

// 删除退款
export function delOrderRefund(ids: string | number | Array<string | number>) {
    return request({
        url: '/order/orderRefund/' + ids,
        method: 'delete'
    });
} 